home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 125
/
Freelog_MarsAvril2015_No125.iso
/
Musique
/
Quod Libet
/
quodlibet-3.3.0-installer.exe
/
bin
/
quodlibet
/
ext
/
events
/
jep118.pyc
(
.txt
)
< prev
next >
Wrap
Python Compiled Bytecode
|
2014-12-31
|
2KB
|
39 lines
# Source Generated with Decompyle++
# File: in.pyc (Python 2.7)
import os
from quodlibet import util
from quodlibet.const import USERDIR
from quodlibet.plugins.events import EventPlugin
outfile = os.path.join(USERDIR, 'jabber')
format = "<tune xmlns='http://jabber.org/protocol/tune'>\n <artist>%s</artist>\n <title>%s</title>\n <source>%s</source>\n <track>%d</track>\n <length>%d</length>\n</tune>"
class JEP118(EventPlugin):
PLUGIN_ID = 'JEP-118'
PLUGIN_NAME = _('JEP-118')
PLUGIN_DESC = _('Output a Jabber User Tunes file to ~/.quodlibet/jabber')
PLUGIN_ICON = 'gtk-save'
PLUGIN_VERSION = '0.13'
def plugin_on_song_started(self, song):
if song is None:
try:
f = file(outfile, 'w')
f.write("<tune xmlns='http://jabber.org/protocol/tune'/>")
except EnvironmentError:
pass
f.close()
else:
try:
f = file(outfile, 'wb')
f.write(format % (util.escape(song.comma('artist')), util.escape(song.comma('title')), util.escape(song.comma('album')), song('~#track', 0), song.get('~#length', 0)))
except EnvironmentError:
pass
f.close()